<!-- 教练 – 我的 – 我的教案			lesson -->
<template>
	<view class="warps">
		<scroll-list ref="list" :option="option" @load="load" @refresh="refresh">
			<view class="" v-for="(item,index) in list" :key="index" >
				<view class="m15 br5" style="box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);">
					<view class=" mr15 ml15  dis-flex" style="height: 100rpx;line-height: 100rpx;">
						<view class="fs28 hui wd20">课程：</view>
						<view class="fs28 ellipsis wd80 right">{{item.course_name}}</view>
					</view>
					<view class="bt mr15 ml15  dis-flex" style="height: 100rpx;line-height: 100rpx;">
						<view class="fs28 hui wd20">教练：</view>
						<view class="fs28 ellipsis wd80 right">{{item.coach_name}}</view>
					</view>
					<view class="bt mr15 ml15  dis-flex" style="height: 100rpx;line-height: 100rpx;">
						<view class="fs28 hui wd20">学员：</view>
						<view class="fs28 ellipsis wd80 right">{{item.user_name}}</view>
					</view>
					<view class="bt mr15 ml15  dis-flex" style="height: 100rpx;line-height: 100rpx;">
						<view class="fs28 hui wd20">日期：</view>
						<view class="fs28 ellipsis wd80 right">{{item.date}} {{item.timestr}}</view>
					</view>
				
					<view v-if="item.lesson" v-for="(item2,index2) in item.lesson" :key="index2"  class=" bt mr15 ml15  dis-flex" style="height: 100rpx;line-height: 100rpx;">
						<view class="fs28 hui wd70 ellipsis">{{item2.plan_name}}：</view>
						<view class="fs28 ellipsis wd30 right">{{item2.xx_name}}</view>
					</view>
					<view class="bt mr15 ml15  dis-flex flex-align-center pt15 pb15" >
						<view class="fs28 hui wd20">备注：</view>
						<view class="fs28  wd80 right">{{item.remark}}</view>
					</view>
				</view>
				
			</view>
		</scroll-list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				page:0,
				option: {
					size: 10,
					auto: true
				},
			}
		},
		onLoad() {
			// 动态导航条文字
			uni.setNavigationBarTitle({
				title: '员工教案'
			})
		},
		methods: {
			init() {
				var json = {
					page: this.page
				}
				this.$http.post(this.$config.UrlPostmyJiaoan, json).then((res) => {
					if (res.status == 1) {
						this.list = res.data
					}
				})
			},
			 // 加载数据
			load(paging) {
				var that = this
				that.page = that.page + 1
				setTimeout(() => {
					var json = {
						page: that.page
					}
					that.$http.post(that.$config.UrlPostmyJiaoan, json).then((res) => {
						if (res.status == 1) {
							var list = res.data.list
							if(list){
								var totalDemo = that.list.concat(list);
								that.list = JSON.parse(JSON.stringify(totalDemo))
								that.$refs.list.loadSuccess({ list: that.list, total: res.data.count });
							}
						}
					})
					
				}, that.$u.random(100, 1000));
			},
		}
	}
</script>

<style scoped>
	.xian {
		width: 622rpx;
		height: 2rpx;
		opacity: 1;
		background: rgba(0, 0, 0, 0.00);
		border: 2rpx solid #e7e7e7;
	}

	.warps {
		/* height:95vh; */
		overflow: hidden;
		background-color: #F6F8FC;
	}

	.notifications-top {
		width: 686rpx;
		height: 368rpx;
		opacity: 1;
		background: #ffffff;
		border-radius: 16rpx;
		box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
		margin: 0 auto;
		margin-top: 24rpx;
	}

	.team-lan {
		width: 76rpx;
		height: 28rpx;
		line-height: 28rpx;
		opacity: 1;
		background: #f1f6ff;
		border-radius: 4rpx;
	}
</style>
